Various tools have been developed for monitoring performance of a virtualized computer system. One such tool, known as VProbes, which is developed by VMware, Inc. of Palo Alto, Calif., enables administrators to “dynamically” instrument various software modules of virtual machines (VMs) running in a virtualized computer system and gather performance data relating to the instrumented software modules for analysis. The tool provides for dynamic instrumentation because the code for probing the software modules can be injected while the VMs are running. As a result, answers to questions such as, “Why is an application running slowly in the virtual machine?” or “Which virtual machines are consuming the majority of the I/O bandwidth?” may be explored without recompilation or downtime. Further details of VProbes are described in the user's manual available from VMware, Inc. entitled “VMware VProbes User Guide,” which is incorporated by reference herein.
A probe script is employed in VProbes as a mechanism to dynamically inject the code for probing the software modules of VMs. The probe script defines one or more probes, where each probe has a trigger and a body of code. The trigger specifies an event of interest in the instrumented software module, such as a read, a write, or a periodic timer tick, and the body of code is executed when the event of interest occurs, i.e., when the probe is triggered. When such a probe script is loaded into a virtualized computer system with running VMs, it is compiled into executable code that is dynamically injected into various executing portions of the virtualized computer system. For security purposes, the probe script is checked during compilation for infinite loops, bad pointers, and generally any portions that could cause the system to hang or crash. When the script is unloaded, the injected code is removed and the virtualized computer system returns to its original state.
VProbes, as described above, is safe, because it ensures through the script compiler that the state of the running virtualized computer system can never change. VProbes is also dynamic, because probes can be injected into a running virtualized computer system without recompilation and downtime of the virtualized computer system. Finally, VProbes has little or no impact on overhead, because it can be unloaded and not add to the overhead of the virtualized computer system when not in use.